﻿@model SKeeper.Application.ViewModels.Items.ItemIndexViewModel
@{
    ViewBag.Title = "Артикли";
}

<h2>Суровини</h2>
<div class="row">
    <div id="result" class="col-xs-8">

        @Html.Partial("_ItemsPartial", Model.Items)

    </div>
    <div class="col-xs-4">
        <h2>Додади суровини</h2>
        @using (Ajax.BeginForm(new AjaxOptions { UpdateTargetId = "result", HttpMethod = "POST", Url="/item/add" }))
        {
          <input type="hidden" name="CompanyId" value="@Model.CompanyId" />
            <div class="form-horizontal">
                
                <hr />
                @Html.ValidationSummary(true, "", new { @class = "text-danger" })
                <div class="form-group">
                    <label class="control-label col-md-2" for="Name">Име</label>
                    <div class="col-md-10">
                        <input type="text" name="Name" class="form-control" />                      
                    </div>
                </div>
                <div class="form-group">
                    <label class="control-label col-md-2" for="Name">Данок</label>
                    <div class="col-md-10">
                        <select type="text" name="Tax" class="form-control">
                            <option value="1" selected>18%</option>
                            <option value="2">5%</option>
                            <option value="3">0%</option>
                        </select>
                    </div>
                </div>
                <div class="form-group">
                    <label class="control-label col-md-2" for="Name">Тип</label>
                    <div class="col-md-10">
                        <select type="text" name="Type" class="form-control">
                            <option value="1" selected>Производ</option>
                            <option value="2">Услуга</option>
                        </select>
                    </div>
                </div>
                <div class="form-group">
                    <label class="control-label col-md-2" for="Name">Мерка</label>
                    <div class="col-md-10">
                        <select type="text" name="Unit" class="form-control">
                            <option value="1" selected>Парче</option>
                            <option value="2">Килограм</option>
                            <option value="3">Литар</option>
                            <option value="4">Порција</option>

                        </select>
                    </div>
                </div>

            </div>
            <input type="submit" value="Креирај" />
        }
    </div>
</div>
@section scripts{
<script src="~/Scripts/jquery.unobtrusive-ajax.min.js"></script>
<script src="~/Scripts/jquery.validate.unobtrusive.js"></script>
    }